import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;


public class Main {

	private static final String INPUT_FILE = "input.txt";
	private static final String OUTPUT_FILE = "output.txt";

	public static void main(String[] args)
	{
		try
		{
			Perceptron alg = extractPerceptron();
			alg.LearnAlg();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
	
	
	public static Perceptron extractPerceptron() throws Exception
	{
		BufferedReader fileReader = new BufferedReader(new FileReader(INPUT_FILE));
		ArrayList<ArrayList<Double>> examples = new ArrayList<ArrayList<Double>>();
		String currLine;
		
		while((currLine = fileReader.readLine()) != null)
		{
			System.out.println(currLine);
			String [] example = currLine.split(", ");
			ArrayList<Double> numericExample =  new ArrayList<Double>();
			numericExample.add(1.0);
			for(int i = 0; i < example.length; i++)
			{
				numericExample.add(Double.parseDouble(example[i]));
			}
			examples.add(numericExample);
			
		}
		
		fileReader.close();
		return new Perceptron(examples);
	}
}
